package ch.ethz.fcl.metrofont;

import java.awt.Color;

public class FontMarkup {
	private String fontname = null;
	private int fontsize = 14;
	private boolean bold;
	private boolean italic;
	private float rise;
	private float spacing;
	private boolean superscript;
	private boolean subscript;
	private Color fontColor;
	private Color backgroundColor;
	private boolean outline;
	private Color outline_color;
	private boolean underline;
	private Color underline_color;
	private boolean overline;
	private Color overline_color;
	private boolean strikethrough;
	private Color strikethrough_color;
	private boolean kerning_on = true;

	public FontMarkup(int size) {
		this.fontname = "Arial";
		this.fontsize = size;
		this.fontColor = new Color(255, 255, 255, 255);
		this.backgroundColor = new Color(255, 255, 255, 255);
	}
	
	public FontMarkup(String name, int size) {
		this.fontname = name;
		this.fontsize = size;
		this.fontColor = new Color(0, 0, 0, 255);
		this.backgroundColor = new Color(255, 255, 255, 255);
	}

	public FontMarkup(String name, int size, Color foreground, Color background) {
		this.fontname = name;
		this.fontsize = size;
		this.fontColor = foreground;
		this.backgroundColor = background;
	}

	public FontMarkup(String name, int size, boolean bold, boolean italic,
			float rise, float spacing, Color foreground, Color background) {
		this.fontname = name;
		this.fontsize = size;
		this.bold = bold;
		this.italic = italic;
		this.rise = rise;
		this.spacing = spacing;
		this.fontColor = foreground;
		this.backgroundColor = background;
		this.outline_color = Color.black;
		this.underline_color = Color.black;
		this.overline_color = Color.black;
		this.strikethrough_color = Color.black;
	}

	public boolean match(FontMarkup fm) {
		if (fm == null)
			return false;

		return fontname.equals(fm.getFontName())
				&& (fontsize == fm.getFontSize())
				&& fontColor.equals(fm.getFontColor());
	}

	public void setFontSize(int size) {
		this.fontsize = size;
	}

	public int getFontSize() {
		return this.fontsize;
	}

	public String getFontName() {
		return this.fontname;
	}

	public void setFontName(String name) {
		this.fontname = name;
	}

	public void setItalic(boolean italic) {
		this.italic = italic;
	}

	public boolean getItalic() {
		return this.italic;
	}

	public void setBold(boolean bold) {
		this.bold = bold;
	}

	public boolean getBold() {
		return bold;
	}

	public void setRise(float rise) {
		this.rise = rise;
	}

	public float getRising() {
		return this.rise;
	}

	public void setSpace(float space) {
		this.spacing = space;
	}

	public float getSpacing() {
		return spacing;
	}

	public void setFontColor(Color color) {
		this.fontColor = color;
	}

	public Color getFontColor() {
		return this.fontColor;
	}

	public void setBackgoundColor(Color color) {
		this.backgroundColor = color;
	}

	public Color getBackgoundColor() {
		return this.backgroundColor;
	}

	public void setOutline(boolean outline) {
		this.outline = outline;
	}

	public boolean getOutline() {
		return this.outline;
	}

	public void setSuperscript(boolean superscript) {
		this.superscript = superscript;
	}

	public boolean getSuperscript() {
		return this.superscript;
	}

	public void setSubscript(boolean subscript) {
		this.subscript = subscript;
	}

	public boolean getSubscript() {
		return this.subscript;
	}

	public void setUnderlineColor(Color color) {
		this.underline_color = color;
	}

	public Color getUnderLineColor() {
		return this.underline_color;
	}

	public void setOverlineColor(Color color) {
		this.outline_color = color;
	}

	public Color getOverlineColor() {
		return this.overline_color;
	}

	public void setOutlinColor(Color color) {
		this.outline_color = color;
	}

	public Color getOutlinColor() {
		return this.outline_color;
	}

	public void setUnderline(boolean underline) {
		this.underline = underline;
	}

	public boolean getUnderline() {
		return this.underline;
	}

	public void setOverline(boolean overline) {
		this.overline = overline;
	}

	public boolean getOverline() {
		return this.overline;
	}

	public void setStrike(boolean strike) {
		this.strikethrough = strike;
	}

	public boolean getStrike() {
		return this.strikethrough;
	}

	public void setStrikeColor(Color color) {
		this.strikethrough_color = color;
	}

	public Color getStrikeColor() {
		return this.strikethrough_color;
	}

	public void setKerning(boolean kerning) {
		this.kerning_on = kerning;
	}

	public boolean getKerning() {
		return this.kerning_on;
	}
}
